package day020;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class ObjectOutputStreamDemo1 {
    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("D:\\day020\\user.txt"));

        User user = new User();
        user.setUserName("itheima");
        user.setPassword("123456");

        oos.writeObject(user);
        oos.close();
    }
}
